//
//  LZCouponManagerListDetailTopTitleCell.m
//  laziz_Merchant
//
//  Created by xbnzd on 17/1/13.
//  Copyright © 2017年 XBN. All rights reserved.
//

#import "LZCouponManagerListDetailTopTitleCell.h"
#import "GiftListLabel.h"

@interface LZCouponManagerListDetailTopTitleCell()
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@end

@implementation LZCouponManagerListDetailTopTitleCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self configureLabel];
}


- (void)loadContentText:(NSString *)contentStr
{
    [self setContentLabelText:contentStr Label:self.titleLabel];
}

- (void)setContentLabelText:(NSString *)text Label:(UILabel *)gLabel
{
    if (text.length != 0) {
        extern CGFloat textLineSpace;
        NSMutableAttributedString *attStr = [[NSMutableAttributedString alloc] initWithString:text];
        NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
        
        [style setLineSpacing:textLineSpace];
        [style setLineBreakMode:NSLineBreakByWordWrapping];
        [style setAlignment:NSTextAlignmentNatural];
        
        [attStr addAttribute:NSParagraphStyleAttributeName value:style range:NSMakeRange(0, attStr.length)];
        gLabel.attributedText = attStr;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}


#pragma mark -
#pragma mark private
- (void)configureLabel
{
//    [self.titleLabel setVerticalAlignment:VerticalAlignmentTop];
    self.titleLabel.preferredMaxLayoutWidth = SCREEN_WIDTH - 20;
}

@end
